package com.ruoyi.daily.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.daily.mapper.XinfengOrderMapper;
import com.ruoyi.daily.domain.XinfengOrder;
import com.ruoyi.daily.service.IXinfengOrderService;

/**
 * 订单Service业务层处理
 * 
 * @author gyy
 * @date 2025-04-19
 */
@Service
public class XinfengOrderServiceImpl implements IXinfengOrderService 
{
    @Autowired
    private XinfengOrderMapper xinfengOrderMapper;

    /**
     * 查询订单
     * 
     * @param id 订单主键
     * @return 订单
     */
    @Override
    public XinfengOrder selectXinfengOrderById(Long id)
    {
        return xinfengOrderMapper.selectXinfengOrderById(id);
    }

    /**
     * 查询订单列表
     * 
     * @param xinfengOrder 订单
     * @return 订单
     */
    @Override
    @DataScope(deptAlias = "d", userAlias = "u")
    public List<XinfengOrder> selectXinfengOrderList(XinfengOrder xinfengOrder)
    {
        return xinfengOrderMapper.selectXinfengOrderList(xinfengOrder);
    }

    /**
     * 新增订单
     * 
     * @param xinfengOrder 订单
     * @return 结果
     */
    @Override
    public int insertXinfengOrder(XinfengOrder xinfengOrder)
    {
        xinfengOrder.setCreateTime(DateUtils.getNowDate());
        return xinfengOrderMapper.insertXinfengOrder(xinfengOrder);
    }

    /**
     * 修改订单
     * 
     * @param xinfengOrder 订单
     * @return 结果
     */
    @Override
    public int updateXinfengOrder(XinfengOrder xinfengOrder)
    {
        xinfengOrder.setUpdateTime(DateUtils.getNowDate());
        return xinfengOrderMapper.updateXinfengOrder(xinfengOrder);
    }

    /**
     * 批量删除订单
     * 
     * @param ids 需要删除的订单主键
     * @return 结果
     */
    @Override
    public int deleteXinfengOrderByIds(Long[] ids)
    {
        return xinfengOrderMapper.deleteXinfengOrderByIds(ids);
    }

    /**
     * 删除订单信息
     * 
     * @param id 订单主键
     * @return 结果
     */
    @Override
    public int deleteXinfengOrderById(Long id)
    {
        return xinfengOrderMapper.deleteXinfengOrderById(id);
    }
}
